<div class="box box-solid">
    <div class="box-body table-responsive no-padding">
            <?php if(!empty($user)): ?>

                    <div class="box-body">
                    <?php if(!empty($user)): ?>
                            <h3 class="box-title">用户基本信息</h3>
                        <table class="table table-bordered table-striped">
                            <tbody>
                            <tr>
                                <td><b>账号: </b></td>
                                <td><?php echo $user['mobile']; ?></td>
                                <td><b>所属承运人账号: </b></td>
                                <td><?php echo $user['carry_sid']; ?></td>
                            </tr>
                            <tr>
                                <td><b>状态: </b></td>
                                <td><?php echo User::model()->getStatusText($user['status']); ?></td>
                            </tr>

                            <tr>
                                <td><b>创建时间: </b></td>
                                <td><?php echo date('Y-m-d H:i:s',$user['ctime']); ?></td>
                                <td><b>上次登录时间: </b></td>
                                <td><?php echo !empty($user['last_login_time']) ? date('Y-m-d H:i:s',$user['last_login_time']):'-'; ?></td>
                            </tr>

                            <tr>
                                <td><b>昵称: </b></td>
                                <td><?php echo $user['nickname'];?></td>
                                <td><b>姓名: </b></td>
                                <td><?php echo $user['name'];?></td>
                            </tr>
                            <tr>
                                <td><b>所在省: </b></td>
                                <td><?php echo $user['province_text'];?></td>
                                <td><b>所在市: </b></td>
                                <td><?php echo $user['city_text'];?></td>
                            </tr>
                            </tbody>
                        </table>

                            <?php if(!empty($driver)): ?>
                        <div class="box-header">
                            <i class="fa fa-user"></i>
                            <h3 class="box-title">司机详情</h3>
                            <table class="table table-bordered table-striped">
                            <tbody>
                            <tr>
                                <td><b>姓名</b></td>
                                <td><?php echo $driver['name'];?></td>
                                <td><b>身份证号码</b></td>
                                <td><?php echo $driver['idcard'];?></td>
                            </tr>
                            <tr>
                                <td><b>开户姓名</b></td>
                                <td><?php echo $driver['account_name'];?></td>
                                <td><b>开户行</b></td>
                                <td><?php echo $driver['open_bank'];?></td>
                            </tr>
                            <tr>
                                <td><b>银行卡号</b></td>
                                <td><?php echo $driver['bank_card'];?></td>
                                <td><b>所属承运人</b></td>
                                <td>
                                <a target="_blank" href="/admin/user/info/sid/<?php echo $driver['carry_sid'] ?>"><?php if(!empty($driver['carry_sid'])){echo $driver['carry_sid'];} ?></a>
                                </td>
                            </tr>

                            </tbody>
                            </table>
                        </div>
            
                            <?php endif; ?>

                        <?php if($user['authentication']>0): ?>
                        <div class="box-header">
                            <i class="fa fa-user"></i>
                            <h3 class="box-title">货主详情</h3>
                        </div>
                        <table class="table table-bordered table-striped">
                            <tbody>
                            <?php if($user['authentication']==1):?>
                            <tr>
                                <td><b>名称</b></td>
                                <td><?php echo $user['name'];?></td>
                                <td><b>简称</b></td>
                                <td><?php echo $user['abbreviation'];?></td>

                                <td>身份证</td>
                                <td><img src="<?php echo WxUtil::getGoodsImgUrl($user['idcard_photo'],300,300);?>"></td>
                            </tr>
                            <tr>
                                <td>性别</td>
                                <td><?php echo User::model()->getGenderText($user['gender']);?></td>
                            </tr>

                            <?php else:?>
                            <tr>
                                <td><b>企业名称</b></td>
                                <td><?php echo $user['enterprise'];?></td>
                                <td><b>联系人</b></td>
                                <td><?php echo $user['link_man'];?></td>
                            </tr>
                            <tr>
                                <td><b>联系方式</b></td>
                                <td><?php echo $user['link_way'];?></td>

                            </tr>
                            <tr>
                            <td>营业执照</td>
                            <td><img src="<?php echo WxUtil::getGoodsImgUrl($user['business_license'],300,300);?>"></td>
                            <td>身份证</td>
                            <td><img src="<?php echo WxUtil::getGoodsImgUrl($user['idcard_photo'],300,300);?>"></td>
                            </tr>

                            <?php endif;?>
                            <tr>
                                <td>发票数</td>
                                <td><?php echo $user['invoice_num'];?><a  href="<?php echo $this->createUrl('invoice/list/sid/'.$user['sid']); ?>">查看</a></td>
                                <td>收发货地址</td>
                                <td><?php echo $user['address_num'];?><a  href="<?php echo $this->createUrl('address/list/sid/'.$user['sid']); ?>">查看</a></td>
                            </tr>
                            </tbody>

                        </table>
                        <?php endif; ?>

                        <?php if(!empty($carry)):?>
                        <div class="box-header">
                            <i class="fa fa-user"></i>
                            <h3 class="box-title">承运人详情</h3>
                        </div>
                        <table class="table table-bordered table-striped">
                            <tbody>
                            <tr>
                                <td><b>名称</b></td>
                                <td><?php echo $carry['name'];?></td>
                                <td><b>简称</b></td>
                                <td><?php echo $user['abbreviation'];?></td>
                                
                                <td><b>是否与中锦合作</b></td>
                                <td><?php echo $carry['is_authorized']==1? '是':'否';?></td>
                            </tr>
                            <tr>
                                <td>承运人类型</td>
                                <td><?php echo User::model()->getUserType($carry['type']);?></td>
                                <td>母公司</td>
                                <td>
                                <a target="_blank" href="/admin/user/info/sid/<?php echo $carry['father_carry_sid'] ?>"><?php if(!empty($carry['father_carry_sid'])){echo CarryShop::model()->getNameBySid($carry['father_carry_sid']);} ?></a>
                                </td>
                            </tr>
                            <?php if($carry['type']==3):?>
                            <tr>
                                <td>身份证</td>
                                <td><img src="<?php echo WxUtil::getGoodsImgUrl($carry['idcard_photo'],300,300);?>"></td>
                                <td>身份证</td>
                                <td><img src="<?php echo WxUtil::getGoodsImgUrl($carry['driving_licence'],300,300);?>"></td>
                            </tr>
                            <?php elseif($carry['type']==4):?>

                            <tr>
                                <td><b>联系人</b></td>
                                <td><?php echo $carry['head'];?></td>
                                <td>联系方式</td>
                                <td><?php echo $carry['head_link_way'];?></td>
                            </tr>
                            <tr>
                                <td><b>社会统一信用代码</b></td>
                                <td><?php echo $carry['credit_code'];?></td>
                                <td>道路运输许可证号</td>
                                <td><?php echo $carry['transport_licence_id'];?></td>
                            </tr>
                            <tr>
                                <td>营业执照</td>
                                <td><img src="<?php echo WxUtil::getGoodsImgUrl($carry['business_license'],300,300);?>"></td>
                                <td>道路运输许可证</td>
                                <td><img src="<?php echo WxUtil::getGoodsImgUrl($carry['transport_licence'],300,300);?>"></td>
                            </tr>
                            <?php else:?>
                            <tr>
                                <td>承运人类型错误</td>
                            </tr>
                            <?php endif;?>

                            </tbody>
                            </table>
                        <?php endif;?>

                    <?php else : ?>
                        <td>无用户信息</td>
                    <?php endif; ?>

            <div class="nav-tabs-custom">
            </div>
        </div>
    <?php endif; ?>
                <a href="<?php echo $this->createUrl('/admin/user/list'); ?>">返回承运人列表</a>
            </div>
    </div>
</div>
